package main.model.island.eventprocessor;

import java.util.ArrayList;

import main.model.island.listener.IslandListener;

public class IslandEventProcessorImp implements IslandEventProcessor {
	
	ArrayList<IslandListener> islandListeners = new ArrayList<IslandListener>();
	
	public void addIslandListener(IslandListener listener) 
	{
		islandListeners.add(listener);
	}
	public void removeIslandListener(IslandListener listener) 
	{
		if(islandListeners.contains(listener)){
			islandListeners.remove(islandListeners.indexOf(listener));
		}
	}
	
	public void fireChangeEvent() {
		for (IslandListener il : islandListeners) {
			il.changeEvent();
		}
	}

}
